/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: xiaotutu
 * Date: 2023-08-06
 * Time: 21:33
 */
public class Test {

    public static void main(String[] args) {
        //计算 1! + 2! + 3! + 4! + 5!
        int sum = 0;
        for (int i = 1; i <= 5; i++) {
            int ret = 1;
            for (int j = 1; j <= i; j++) {
                ret *= j;
            }
            sum += ret;
        }
        System.out.println(sum);
    }
    public static void main2(String[] args) {
        //找到 100 - 200 中所有 3 的倍数
        int num = 100;
        while(num<=200) {
            if(num % 3 != 0) {
                num++;
                continue;
            }
            System.out.println("所有3的倍数是："+num);
            num++;
        }
    }
    public static void main1(String[] args) {
        //找到 100 - 200 中第一个 3 的倍数
        int num = 100;
        while(num<=200) {
            if(num % 3 ==0) {
                System.out.println("第一个3的倍数是：" + num);
                break;
            }
            num++;
        }
    }
}
